/* GUI CONVERTED from lvlvdrp.p (converter v1.76) Fri Sep  6 03:26:01 2002 */
/* lvlvdrp.p - DETAILED LICENSE VIOLATION REPORT                              */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3 $                                                           */
/* Revision: 1.2       BY: Deepali Kotavadekar    DATE: 07/18/02  ECO: *P08G* */
/* $Revision: 1.3 $    BY: Jean Miller            DATE: 09/05/02  ECO: *P0HF* */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/*V8:ConvertMode=Report                                                       */

/* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

define variable l_prod  like lvr_product label "Application"        no-undo.
define variable l_prod1 like lvr_product label "To"                 no-undo.
define variable l_date  as   date        label "Date"               no-undo.
define variable l_date1 as   date        label "To"                 no-undo.
define variable l_user  like usr_userid  label "User"               no-undo.
define variable l_user1 like usr_userid  label "To"                 no-undo.
define variable l_type  as   character   label "Type of Violation"
   format "x" no-undo.
define variable l_sort  as   character   extent 4 format "x(30)"    no-undo.

/* Temp table of products for audit */
{lvrpttt.i "new"}

assign
   l_sort[1] = "1 - " + getTermLabel("DATE_EXPIRY",22)
   l_sort[2] = "2 - " + getTermLabel("APPLICATION_USAGE",22)
   l_sort[3] = "3 - " + getTermLabel("LICENSE_COUNT",22)
   l_sort[4] = "4 - " + getTermLabel("NON_LICENSED_PRODUCT",32).


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
l_prod  colon 20
   l_prod1 colon 54
   l_date  colon 20
   l_date1 colon 54
   l_user  colon 20
   l_user1 colon 54
   l_type  colon 20
   l_sort[1] at 33 no-label
   l_sort[2] at 33 no-label
   l_sort[3] at 33 no-label
   l_sort[4] at 33 no-label
   skip(1)
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

{wbrp01.i}

mainloop:
repeat :

   if l_prod1 = hi_char then
      l_prod1 = "".

   if l_date  = low_date then
      l_date  = ?.

   if l_date1 = hi_date then
      l_date1 = ?.

   if l_user1 = hi_char then
      l_user1 = "".


   display l_sort with frame a.

   if c-application-mode <> 'web' then
      update
         l_prod
         l_prod1
         l_date
         l_date1
         l_user
         l_user1
         l_type
      with frame a.

   {wbrp06.i &command = update
             &fields  = "l_prod l_prod1
                         l_date l_date1
                         l_user l_user1
                         l_type"
             &frm     = "a"}

   if l_type <> ""
      and (l_type < "1" or l_type > "4")
   then do:
      /* INVALID OPTION */
      {pxmsg.i &MSGNUM=712 &ERRORLEVEL=3}
      next-prompt l_type with frame a.
      undo, retry.
   end. /* IF l_type <> "" ... */

   if (c-application-mode <> 'web')
   or (c-application-mode  = 'web' and c-web-request begins 'data')
   then do:

      bcdparm = "".
      {mfquoter.i l_prod}
      {mfquoter.i l_prod1}
      {mfquoter.i l_date}
      {mfquoter.i l_date1}
      {mfquoter.i l_user}
      {mfquoter.i l_user1}
      {mfquoter.i l_type}

      if l_prod1 = "" then
         l_prod1 = hi_char.

      if l_date = ? then
         l_date = low_date.

      if l_date1 = ? then
         l_date1 = hi_date.

      if l_user1 = "" then
         l_user1 = hi_char.

   end. /* IF (c-application-mode <> 'web') .... */

   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "printer"
               &printWidth = 132
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "yes"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   /* Create the temp table of products to display */
    for each lvr_det fields (lvr_date lvr_product lvr_type) where lvr_product >= l_prod and lvr_product <= l_prod1
        and (lvr_type = l_type or l_type = "") no-lock break by lvr_product:
        if first-of(lvr_product) then do:
            create tt_products.
            assign
                t_product = lvr_product.
        end.
    end.

    {mfphead.i}

   /* REPORT PRINTING */
    {gprun.i ""lvlvdrpa.p"" "(input l_date, input l_date1, input l_user, input l_user1, input l_type)"}

   /* REPORT TRAILER */
    {mfrtrail.i}

end. /* REPEAT */

{wbrp04.i &frame-spec = a}
